home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Snippets / sscanf / README < prev    next >
Encoding:
Text File  |  1994-05-06  |  2.4 KB  |  62 lines  |  [TEXT/ALFA]

  1. 5/94 - Since this code was created some time ago, it's performance may
  2. not compare in the same way with the Think libraries.  Therefore, I
  3. cannot claim with such confidence as I did in the past that this code
  4. is such-in-such faster than the default routines.
  5.  
  6. ------------------------
  7.  
  8. README  for the freely-distributable sscanf() implementation.
  9.  
  10. For any questions, feel free to email me at
  11. brentb@math.tamu.edu.
  12. ----------------------------------------------
  13.  
  14. What is this?
  15.   
  16.   This mess of code is a freely-distributable sscanf() implementation
  17. that I needed, felt others would need/want, and is something that
  18. I enjoyed writing.  Always using the built-in sscanf functionality
  19. in my own programs made me often wonder how you do something like this.
  20. From my experience with NFAs and more importantly DFAs, I knew how you
  21. could approach the scanning problem, but how do you do it quickly?
  22.  
  23. This sscanf() implementation offers a few advantages over the standard
  24. Think C provided function:
  25.  
  26. * No globals used at all.  (No a5 worries & can be used in stand-alone code)
  27. * Register independent     (again, no problems with a4/a5 worlds)
  28. * Fast scanning times
  29.   - This is the main goal I had in mind.  I wanted to write something that
  30.     was quicker.  The basic string/integer conversions I wrote were 
  31.     definitely quicker, but my original floating point scanning was
  32.     plain garbage.  Fortunately, Stepan Riha took that part over and 
  33.     greatly increased the conversions by rewriting all of the floating 
  34.     point-related code.
  35. * The Think C routines, if used, relied on all sorts of extra garbage 
  36.     from the ANSI libraries.  If you needed the sscanf function, you had to
  37.     put up with an extra 18K of fairly unused code.
  38.     
  39. If you need something to help you over the above obstacles, then you
  40. may want to try this code.  For performance measurements, see the beginning
  41. 60 lines or so of mysscanf.c.
  42.  
  43. The Code
  44.  
  45. The code was developed with Think C and *should* be totally portable to
  46. any other ANSI C compiler.
  47.  
  48. There is a file, sprintf.c, that I did not write.  Tim Endres sent me that
  49. copy with permission to redistribute it with my sscanf() code.  His code
  50. implements the, you guessed it, sprintf() counterpart.
  51.  
  52. ---------------------
  53.  
  54. As always, if you find a bug or other undocumented feature in the code,
  55. please email me.  I'd like to know about any anomalies you believe are
  56. there.
  57.  
  58. Enjoy!
  59.   Brent Burton
  60.   brentb@math.tamu.edu
  61.  
  62.